package com.rxst.msg.webSocket.controller;

import com.rxst.msg.base.ResponseVo;
import com.rxst.msg.dto.search.MsgxEquipmentSearchDto;
import com.rxst.msg.utils.MapUtils;
import com.rxst.msg.webSocket.utils.RedisUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * @author bin
 * @version 1.0
 * @data 2023/11/13 10:18
 */
@RestController
@RequestMapping("plugFlow")
@Api(value = "推流地址", tags = "推流地址")
@Slf4j
public class PlugFlowController {


    RedisUtil redisUtil = new RedisUtil();

    /**
     * 推流地址列表
     */
    @GetMapping("/list")
    @ApiOperation("获取推流地址列表")
    public ResponseVo list(String username) {
        if (StringUtils.isNotBlank(username)) {
            log.info("缓存中的所有数据为: " + redisUtil.hget("plugFlowList",username));
            return ResponseVo.ok(redisUtil.hget("plugFlowList",username));
        } else {

            log.info("缓存中的所有数据为: " + redisUtil.hget("plugFlowList"));
            return ResponseVo.ok(redisUtil.hget("plugFlowList"));
        }
    }
}
